<?php

namespace App\Controllers\v1;

use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use common\utils\SysCode;
use App\Controllers\BaseController;
use App\Services\UserService;
use App\Events\UserLogin;
use App\User;
use App\Services\HelpService;

class HelpController extends BaseController
{
    public $allows = ['getWalletList','get3third'];
    //获取公告列表
    public function getList(Request $request)
    {
        $type = $request->get("type", 1);
        $page = $request->get("page", 1);
        $pageSize = $request->get("page_size", 15);
        $type = $type == 1 ? 2 : ($type == 2 ? 3 : 1);
        $data = HelpService::getnoticeList(Auth::user(), $type, $page, $pageSize);
        return $data;
    }

    //获取文案管理
    public function getBottom(Request $request)
    {
        $type = $request->get("pf", "pc");
        return HelpService::getHelpCopyList($type);
    }

    //第三方客服
    public function get3third(Request $request)
    {
        return HelpService::get3thService();
    }

    //获取合作商图片,底部合作商
    public function getCollaborate(Request $request)
    {
        return HelpService::getCollaborate();
    }

    //h5个人中心菜单列表
    public function getWalletList(Request $request)
    {
        return HelpService::getWalletList();
    }
}
